/**
 *
 */
package com.oron3.locker;

import android.app.Application;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;

/**
 * @author Ofek
 *
 */
public class LockApplication extends Application {
	public static LockApplication context;

	/*
	 * (non-Javadoc)
	 *
	 * @see android.app.Application#onCreate()
	 */
	@Override
	public void onCreate() {
		super.onCreate();
		context = this;
		validateVersion();
	}

	private void validateVersion() {

		try {
			final PackageInfo packageInfo = getPackageManager().getPackageInfo(context.getPackageName(), 0);
			if (packageInfo.versionCode < 5)
				tryToRetrieveOldVersion();
		} catch (final NameNotFoundException e) {
			tryToRetrieveOldVersion();
		}
	}

	private void tryToRetrieveOldVersion() {

	}
}
